<template>
	<view class="container">
		<u-grid col="2" :customStyle="GridStyle" :border="true">
			<u-grid-item v-for="(item,index) in list" :key="index" :customStyle="ItemStyle" @click="getPages"
				:name="item.url">
				<u-icon :customStyle="IconStyle" :name="item.name" :size="40"></u-icon>
				<text class="grid-text">{{item.title}}</text>
			</u-grid-item>
		</u-grid>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						url: '/pages/manage/source/index',
						name: 'more-circle-fill',
						title: '客户来源'
					},
					{
						url: '/pages/manage/highsea/index',
						name: 'account-fill',
						title: '客户公海'
					},
					{
						url: '/pages/manage/privatesea/index',
						name: 'account',
						title: '客户私海'
					},
					{
						url: '/pages/manage/receive/index',
						name: 'plus-people-fill',
						title: '领取记录'
					},
					{
						url: '/pages/manage/visit/index',
						name: 'server-fill',
						title: '回访记录'
					},
					{
						url: '/pages/manage/recycle/index',
						name: 'trash-fill',
						title: '客户回收站'
					},
					{
						url: '/pages/manage/order/index',
						name: 'order',
						title: '课程订单'
					}
				],
				IconStyle: {
					color: "#18bc9c",
					marginBottom: '.2em',
				},
				GridStyle: {
					borderBottom: '1px solid #dadbde'
				},
				ItemStyle: {
					padding: '1.5em 0em'
				}
			}
		},
		methods: {
			getPages(url) {
				let LoginUser = uni.getStorageSync('LoginUser') ? uni.getStorageSync('LoginUser') : {}
				if (JSON.stringify(LoginUser) == '{}') {
					uni.showToast({
						title: '未登陆，请先登陆',
						icon:'none',
						duration: 2000,
					})
					return
				}
				uni.navigateTo({
					url: url
				})


			}
		}
	}
</script>

<style>
	.container {
		height: 100%;
		margin: 0;
		box-sizing: border-box;
	}
</style>